/** Definition of the Numeric class.
 * @file Word.h
 * @author Jeremy Schultz
 */

#ifndef	__WORD_H_
#define	__WORD_H_

#include <string>
#include <sstream>
#include <vector>
#include "Token.h"

#include "WordData.h"
#include "DataNumber.h"
#include "DataBool.h"
#include "DataID.h"
#include "DataProcedure.h"


#define WORD	static_cast<Word*>

using namespace std;

/** Provide support for a Word Token.
 */
class Word : public Token	{
	private:
		string lex;			/**< Stores the lexeme */
		int level;			/**< Stores the level */
		int offset;			/**< Stores the offset */
		WordData* data;		/**< Stores the data */

	public:
		/** Constructor.
		 */
		Word();

		/** Constructor.
		 * @param _lex The lexeme string of the token
		 */
		Word(string _lex);

		/** Constructor.
		 * @param _lex The lexeme string of the token
		 * @param _type The lexeme string of the token
		 */
		Word(string _lex, TokenType _type);

		/** Getter - lex.
		 * @return The lexeme string of the token
		 */
		string Lex();

		/** Setter - lex.
		 * @param _lex  Set lex to this
		 */
		void setLex(string _lex);

		/** Getter - level.
		 * @return The level of the token in the blocks
		 */
		int Level();

		/** Setter - level.
		 * @param _level  Set level to this
		 */
		void setLevel(int _level);

		/** Getter - offset.
		 * @return The offset of the token in the block
		 */
		int Offset();

		/** Setter - offset.
		 * @param _offset  Set offset to this
		 */
		void setOffset(int _offset);

		/** Getter - data.
		 * @return The data
		 */
		WordData* Data();

		/** Setter - data (data).
		 * @param _data Set data to this
		 */
		void setData(WordData* _data);

		/** Setter - data (DataType).
		 * @param type Set data to this
		 */
		void setData(WordData::DataType type);

		/** Setter - data (DataType).
		 * @param type Set data to this
		 * @param size Set array size to this
		 */
		void Word::setData(WordData::DataType type, int size);

		/** Setter - data (Number).
		 * @param _value Set data to this
		 */
		void setData(int value);


		/** Setter - data (Bool).
		 * @param value Set Boolean to this value
		 */
		void setData(bool value);

		/** Setter - data (ID).
		 * @param _word Set ID to this value
		 */
		void setData(string word);

		/** A String representation of Word.
		 * @return A string
		 * The string format will be: <br>
		 *  type: <i>int</i> lex: <i>string</i>
		 */
		string toString();

		/** Defines the Keywords for PL.
		 * @return An array of strings
		 */
		static const string* Keywords();
};


#endif
